package chuishop.yiqimaicai.service.Impl;

import chuishop.yiqimaicai.mapper.DiscountsMapper;
import chuishop.yiqimaicai.pojo.Discounts;
import chuishop.yiqimaicai.service.DiscountsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DiscountsServiceImpl implements DiscountsService {

    @Autowired
    private DiscountsMapper discountsMapper;

    @Override
    public List<Discounts> findAllDiscounts() {
        return discountsMapper.findAllDiscounts();
    }

    @Override
    public List<Discounts> selectDiscountsByName(String input) {
        return discountsMapper.selectDiscountsByName(input);
    }

    @Override
    public boolean addDiscounts(Discounts discounts) {
        return discountsMapper.addDiscounts(discounts)>0;
    }

    @Override
    public boolean deleteDiscounts(String[] ids) {
        return discountsMapper.deleteDiscounts(ids)>0;
    }

    @Override
    public boolean updateDiscounts(Discounts discounts) {
        return discountsMapper.updateDiscounts(discounts)>0;
    }
}
